MyGame.Preloader = function(game){
};
MyGame.Preloader.prototype = {
    create:function(){
		this.stage.backgroundColor = '#fff';
        this.load.onFileComplete.add(this.fileComplete, this);
        this.load.onLoadComplete.add(this.loadComplete, this);
        this.text = this.add.text(this.world.width/2, this.world.height/2-50, '', { fill: '#fff' });
        this.text.anchor.set(0.5);
        this.start();
    },
    start:function(){
    	
    	//load
    	//this.load.audio('audio_oncell', 'assets/oncell.mp3');


		//s0
		for(var i=1;i<=20;i++){
			this.load.image('door-'+i+'','assets/door-'+i+'.jpg');
		}

		

		this.load.image('touch1','assets/touch1.png');
		this.load.image('touch2','assets/touch2.png');

		//s1
		this.load.image('logo','assets/logo.png');
		this.load.image('s1_bg','assets/s1_bg.jpg');
		this.load.image('s1_zi','assets/s1_zi.png');
		this.load.image('s1_chart_1','assets/s1_chart_1.png');
		this.load.image('s1_chart_2','assets/s1_chart_2.png');
		this.load.image('touch_text','assets/touch_text.png');

		

		//s2
		this.load.image('s2_s3_bg','assets/s2_s3_bg.jpg');
		this.load.image('earth','assets/earth.png');
		this.load.image('s2_jizhan','assets/s2_jizhan.png');
		this.load.image('wifi','assets/wifi.png');
		this.load.image('jizhan_5g','assets/jizhan_5g.png');


		//s3
		this.load.image('s3_bg','assets/s3_bg.jpg');
		this.load.image('s3_ganzi','assets/s3_ganzi.png');
		this.load.image('s3_zi','assets/s3_zi.png');

		//s4
		this.load.image('s4_text_1','assets/s4_text_1.png');
		this.load.image('s4_text_2','assets/s4_text_2.png');
		this.load.image('s4_text_3','assets/s4_text_3.png');
		this.load.image('s4_timer_3','assets/s4_timer_3.png');
		this.load.image('s4_timer_2','assets/s4_timer_2.png');
		this.load.image('s4_timer_1','assets/s4_timer_1.png');

		//s5
		this.load.image('s5_bg','assets/s5_bg.jpg');
		this.load.image('s5_touping','assets/s5_touping.png');
		this.load.image('s5_text','assets/s5_text.png');

		//s5_1
		this.load.image('s5_1_bg','assets/s5_1_bg.jpg');
		this.load.image('s5_1_huaxue','assets/s5_1_huaxue.png');

		//s6
		this.load.image('s6_bg','assets/s6_bg.jpg');
		this.load.image('s6_huoche','assets/s6_huoche.png');
		this.load.image('s6_langan','assets/s6_langan.png');

		//s6_1
		this.load.image('s6_1_bg','assets/s6_1_bg.jpg');
		this.load.image('s6_1_mask','assets/s6_1_mask.png');
		this.load.image('s6_1_text_1','assets/s6_1_text_1.png');
		this.load.image('s6_1_text_2','assets/s6_1_text_2.png');
		this.load.image('s6_1_text_3','assets/s6_1_text_3.png');

		//s7
		this.load.image('s7_bg','assets/s7_bg.jpg');
		this.load.image('s7_text_1','assets/s7_text_1.png');
		this.load.image('s7_text_2','assets/s7_text_2.png');
		this.load.image('s7_text_3','assets/s7_text_3.png');
		for(var i=0;i<=18;i++){
			this.load.image('cl_'+i+'','assets/cl_'+i+'.png');
		}

		//s8
		this.load.image('s8_bg','assets/s8_bg.jpg');

		//s8_1
		this.load.image('s8_1_bg','assets/s8_1_bg.jpg');
		this.load.image('s8_1_1_bg','assets/s8_1_1_bg.jpg');
		this.load.image('s8_1_zi','assets/s8_1_zi.png');
		this.load.image('s8_1_timu','assets/s8_1_timu.png');


		//s9
		this.load.image('s9_bg','assets/s9_bg.jpg');
		this.load.image('s9_long','assets/s9_long.png');




        this.load.start();
    },
    fileComplete:function(progress){
        this.text.setText( + progress + "%");
    },
    loadComplete:function(){
		console.log('加载完成,出现跳过按钮');
		// $('.loading-video').remove();

		loadingFinish = true;
		
		//this.state.start('s1');
        
    }
};